<!-- 搜索表单 -->
<template>
  <ele-card :body-style="{ paddingBottom: '2px' }">
    <el-form label-width="72px" @keyup.enter="search" inline @submit.prevent>
      <el-form-item label="所属站点">
        <el-radio-group v-model="form.status" @change="search">
          <el-radio-button :label="1">已开通</el-radio-button>
          <el-radio-button :label="0">未开通</el-radio-button>
        </el-radio-group>
      </el-form-item>

      <br />
      <el-form-item label="城市名">
        <el-input
          clearable
          v-model.trim="form.region_name"
          placeholder="请输入"
        />
      </el-form-item>

      <el-form-item label-width="16px">
        <el-button type="primary" @click="search">查询</el-button>
      </el-form-item>
    </el-form>
  </ele-card>
</template>

<script setup>
  import { useFormData } from '@/utils/use-form-data';

  const emit = defineEmits(['search']);

  /** 表单数据 */
  const [form] = useFormData({
    region_name: '',
    status: 1
  });

  /** 搜索 */
  const search = () => {
    emit('search', { ...form });
  };
</script>
